<!DOCTYPE html>
<style>
#a, #d {
    display: inline-block;
}
#b, #c {
    width:25px;
    height:50px;
    background: blue;
    float: left;
}
</style>
<p>There should be a blue <em>square</em> below.</p>
<div id="container">
    <div></div><div id="a"></div><div></div><div id="b"></div><div id="c"></div>
</div>
<script>
    document.body.offsetTop;
    var inline = document.createElement('div');
    inline.setAttribute("id", "d");
    container.insertBefore(inline, document.getElementById("c"));
</script>
